// Package form_check @program: seastargoMicroService
//@author: edte
//@create: 2021-12-25 12:58
package form_check

import (
	"errors"
	"strings"
)

func RegisterFormCheck(userNum string, userPassword string, userEmail string) error {
	if len(userNum) != 11 {
		return errors.New("手机号号码不正确")
	}
	if !strings.ContainsAny(userPassword, "qwertyuioplkjhgfdsazxcvbnm | QWERTYUIOPLKJHGFDSAZXCVBNM") {
		return errors.New("账号密码安全度低")
	}
	if !strings.Contains(userEmail, "@qq.com") && !strings.Contains(userEmail, "@163.com") && !strings.Contains(userEmail, "@gmail.com") {
		return errors.New("邮箱号不正确")
	}
	return nil
}
